/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.xmlProject.listener;

import com.xmlProject.DTO.ProductDTO;
import com.xmlProject.ultils.DBUltils;
import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;

/**
 * Web application lifecycle listener.
 * @author Admin
 */
public class SessionListener implements HttpSessionListener {

    public void sessionCreated(HttpSessionEvent se) {
        HttpSession session = se.getSession();
        ProductDTO[] products = DBUltils.getProductInfos();
        session.setAttribute("PRODUCTS", products);
    }

    public void sessionDestroyed(HttpSessionEvent se) {
        
    }
}
